<template>
  <view class="wrap bd">
    <u-table>
      <u-tr style="height: 120rpx; background-color: #ffffff">
        <u-th class="bd t1">接种科室</u-th>
        <u-th class="bd t1">接种疫苗</u-th>
        <u-th class="bd t1">接种状态</u-th>
        <u-th class="bd t1">完成时间</u-th>
      </u-tr>
      <u-tr v-for="(v, index) in listAd" style="height: 150rpx">
        <u-td class="bd t1">{{ v.deptName }}</u-td>
        <u-td class="bd t1"
          >{{ v.vaccinesName }}(第{{ v.num }}/{{ v.total }}针)</u-td
        >
        <u-td class="bd t1">{{ v.checkType == 1 ? "未完成" : "完成" }}</u-td>
        <u-td class="bd t1">{{ v.successTime }}</u-td>
      </u-tr>
    </u-table>
    <u-toast ref="uToast" />
  </view>
</template>

<script>
import { parseTime } from "@/utils/parseTime";
export default {
  data() {
    return {
      listAd: [], //预约登记疫苗
    };
  },
  onLoad() {
    this.getAddList();
  },
  onReady() {
    // this.getUiStyle();
  },
  methods: {
    getUiStyle() {
      var style = plus.navigator.getUiStyle();
      if ("dark" == style) {
        console.log("当前为暗黑模式");
        uni.setTabBarStyle({
          backgroundColor: "#1B1C1E",
        });
        uni.setNavigationBarColor({
          frontColor: "#ffffff",
          backgroundColor: "#1B1C1E",
          animation: {
            duration: 400,
            timingFunc: "easeIn",
          },
        });
      } else {
        console.log("当前为普通模式");
      }
    },
    // tab栏切换
    change(index) {
      this.swiperCurrent = index;
    },
    // 获取疫苗登记信息
    getAddList() {
      let self = this;
      this.config.get("/subscribesInfos/getInoculationData", {}).then((res) => {
        if (res.data.code === 200) {
          console.log(res);
          this.listAd = res.data.data;
        } else {
          uni.showToast({
            title: self.config.handleError(res.data),
            icon: "none",
          });
        }
      });
    },
  },
};
</script>
<style scoped lang="less">
uni-swiper {
  height: 100% !important;
}
/* #ifndef H5 */
page {
  height: 100%;
  background-color: #f2f2f2;
}
/* #endif */

uni-view.u-tabs-box {
  border-top: 1px solid #eeeeee;
  border-bottom: 1px solid #eeeeee;
}
.carinfo {
  border-top: 1px solid #eeeeee;
  margin-bottom: 25rpx;
}
.wrap {
  flex-direction: column;
  height: calc(100vh - var(--window-top));
  width: 100%;
  margin-bottom: 30rpx;
  position: fixed;
  background-color: #ffffff;
}

.swiper-box {
  flex: 1;
}
.swiper-item {
  height: 100%;
  background-color: white;
}
</style>
<style scoped>
@media (prefers-color-scheme: closedark) {
  .bd {
    background-color: #1b1c1e !important;
  }
  .t1 {
    color: #ccc !important;
  }
}
</style>